package com.rongcheng.fortestlist.viewPager;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;

import java.util.ArrayList;
import java.util.List;

/**
 * @author frc
 *         created at 16-12-22.
 */

public class TestFragmentPagerAdapter extends FragmentStatePagerAdapter {
    public TestFragmentPagerAdapter(FragmentManager fm) {
        super(fm);
    }

    private List<Fragment> list = new ArrayList<>();

    public void update(List<Fragment> list) {
        this.list = list;
    }

    @Override
    public Fragment getItem(int position) {
        return list.get(position);
    }

    @Override
    public int getCount() {
        return list.size();
    }
}
